package clas.ac.cn.common.exception;


import clas.ac.cn.common.vo.ErrMessage;

public class IException extends Exception {
    private Integer code;

    public IException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public IException(IException e) {
        super(e.getMessage());
        this.code = e.getCode();
    }

    public IException(ErrMessage errMessage) {
        super(errMessage.getMessage());
        this.code = errMessage.getCode();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public IException(String message) {
        super(message);
        this.code = -1;
    }
}
